<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>JS函数function类型</title>
	</head>
	<body>
		函数的定义已使用
	</body>
	<script>
		function  box (num){
				alert("第一种函数声明=" +num);//
			return num;
		
		}
		var sum = function(n1,num){
				alert("函数表达式="+num);//
			return n1(num)+num;
		
			
		}
		
		var count = new Function("num1","num2","return num1+num2");
		alert(count(1,2)+"=构造函数");
		var result  =sum(box,2);
		alert(result);   //4
		
		
		
	</script>
</html>
